#pragma once
#include "UltimatePhysXPrerequisites.h"
#include "UltimatePhysXPrecompiled.h"
#include "UltimatePhysicsContactListener.h"
#include "UltimatePhysicsActor.h"

//class EntityControl;

class  _UltimatePhysXExport UltimatePhysXContactReport : public NxUserContactReport
{	

	
	std::vector<UltimatePhysicsContactListener*> listenerList;


	void onContactNotify(NxContactPair& pair, NxU32 events)	
	{		
		UltimatePhysicsActor* actor1 = static_cast<UltimatePhysicsActor*>( pair.actors[0]->userData );	
		UltimatePhysicsActor* actor2 = static_cast<UltimatePhysicsActor*>( pair.actors[1]->userData );
		
		for(int i=0; i<listenerList.size(); i++)
		{
			listenerList[i]->onContactNotify(actor1,actor2);
		}

	}

	

public:

	void addContactListener(UltimatePhysicsContactListener* listener)
	{
		listenerList.push_back(listener);
	}
	

}physXContactReport;